{% extends '::base.html.twig' %}

{% block javascripts %}
	<script type="text/javascript" src="{{ asset('bundles/rtscraftmain/js/utils/managementUtils.js') }}"></script>
{% endblock %}

{% block stylesheets %}
        <link rel="stylesheet" href="{{ asset('bundles/rtscraftmain/css/style.css') }}" type="text/css" media="all" />
	<link rel="stylesheet" href="{{ asset('bundles/rtscraftmain/css/management.css') }}" type="text/css" media="all" />
{% endblock %}

{% block body %}
<script type="text/javascript" src="{{ asset('bundles/rtscraftmain/js/treemenu.js') }}"></script>

<div class="main">
  {{ info }}
  <div id="leftManagement">
    <ul>
      <input type="text" value="Add..." id="in_RTSCraftTreeRoot"/>
      <button type="button" onclick="element_add('{{ path('_management_add') }}', 'RTSCraftTreeRoot');">+</button>
      {% for key, value in tree %}
      <li onclick="javascript:hideshow(event);" id={{key}} >
	<button type="button" onclick="element_remove('{{ path('_management_remove') }}', '{{ key }}', null)">
	  -
	</button>
	{{key}}
      </li>
      <ul style="visibility:hidden; position:absolute;">
	{% for svalue in value %}
	<li>
	  <button type="button" onclick="element_remove('{{ path('_management_remove') }}', '{{ key }}', '{{ svalue }}')">
	    -
	  </button>
	  <span onclick="fill_frame('{{ key }}', '{{ path('_entity_edit') }}', '{{ svalue }}')">{{ svalue }}</span>
	</li>
	{% endfor %}
	<li>
	  <input type="text" id="in_{{ key }}" value="Add..."/>
 	  <button type="button" onclick="element_add('{{ path('_management_add') }}', '{{ key }}');">
	    +
	  </button>
	</li>
</ul>
{% endfor %}
    </ul>
  </div>
  
  <iframe id="rightManagement">
	<!--img src="{{asset('bundles/rtscraftmain/images/elephpant.png')}}" /-->
  </iframe>

</div>
{% endblock %}
